﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Ankin.EHBH.CommonUtil.Util;

namespace Ankin.EHBH.Web.Controls
{
    public partial class leftMission : System.Web.UI.UserControl
    {
        private int unapproveCount;
        private int approvedCount;
        private int issueCount;
        private int planBuyCount;
        /// <summary>
        /// 已拒绝
        /// </summary>
        private int denyCount;
        /// <summary>
        /// 已取消
        /// </summary>
        private int cancelCount;
        /// <summary>
        /// 已取消
        /// </summary>
        public int CancelCount
        {
            get { return cancelCount; }
            set { cancelCount = value; }
        }
        /// <summary>
        /// 已拒绝
        /// </summary>
        public int DenyCount
        {
            get { return denyCount; }
            set { denyCount = value; }
        }                
        /// <summary>
        /// 计划采购
        /// </summary>
        public int PlanBuyCount
        {
            get { return planBuyCount; }
            set { planBuyCount = value; }
        }
        /// <summary>
        /// 出库数量
        /// </summary>
        public int IssueCount
        {
            get { return issueCount; }
            set { issueCount = value; }
        }
        /// <summary>
        /// 已审核数量
        /// </summary>
        public int ApprovedCount
        {
            get { return approvedCount; }
            set { approvedCount = value; }
        }
        /// <summary>
        /// 未审核数量
        /// </summary>
        public int UnApproveCount
        {
            get { return unapproveCount; }
            set { unapproveCount = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            string user_id = null;
            if (Session[EHBHConstant.SESSION_ROLE_APPLY_USER]!=null && Session[EHBHConstant.SESSION_ROLE_APPLY_USER].ToString()=="Y") {
                 user_id = Session[EHBHConstant.SESSION_USERID].ToString();
            }
            BLL.BllleftMission bllTask = new Ankin.EHBH.BLL.BllleftMission();
            //未审核
            unapproveCount = bllTask.GetUnApproveCount(user_id);
            //已审核
            approvedCount = bllTask.GetApprovedCount(user_id);
            //已领取            
            IssueCount = bllTask.GetIssueCount(user_id);
            //采购计划
            PlanBuyCount = bllTask.GetPlanBuyCount(user_id);
            //获取已拒绝数量
            DenyCount = bllTask.GetDenyCount(user_id);
            //获取已取消数量
            CancelCount = bllTask.getCancelCount(user_id);
        }

        public bool GetSessionRoleApply
        {
            get { if (Session[EHBHConstant.SESSION_ROLE_APPLY_USER] != null && Session[EHBHConstant.SESSION_ROLE_APPLY_USER].ToString() == "Y")
            {
                return true;
            }
            else {
                return false;
            }
            }
        }
    }
}